<template>
  <!-- 我的收藏 -->
  <div class="my-collection">
    <van-cell :title="item.name" v-for="(item,idx) in myCollectionList" :key="idx" is-link @click.native="skipRouter(item)" />
  </div>
</template>

<script>
  export default {
    name: 'myCollect',
    data() {
      return {
        myCollectionList: [],
      }
    },
    mounted() {
      // 获取收藏列表
      this.getMyCollectionList();
    },
    methods: {
      getMyCollectionList() {
        this.myCollectionList = [{
          name: '办公通知',
          type: 'notice',
          url: 'officeNotice',
          isCollect: true
        },{
          name: '教学通知',
          type: 'notice',
          url: 'notificationlist',
          isCollect: true
        },{
          name: '公示公告',
          type: 'notice',
          url: 'notificationlist',
           isCollect: true
        },{
          name: '系统应用',
          type: 'notice',
          url: 'sysTemApplication',
          isCollect: true
        }]
      },
      // 页面跳转
      skipRouter(item) {
        this.$router.push({
          name: item.url,
          params: { isCollect: item.isCollect }
        })
        item.headerNavTitle = '我的收藏';  // 将当前页面加载到路由中
        this.$store.dispatch('set_header_title',item)
      }
    }
  }
</script>

<style lang="scss" scoped>

</style>